﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GWModflow.FileLayers
{
   public class PHorizontalFlowBarrier:Package
    {
       public PHorizontalFlowBarrier()
       {
           this._fileType = FileType.HFB6;
           this.Fname = "solution.hfb";
           this.Nunit = 23;
       }
       int _NPHFB;
       /// <summary>
       /// 在Items 2 and 3定义的水平流动屏障的参数个数
       /// </summary>
       public int NPHFB
       {
           get { return _NPHFB; }
           set { _NPHFB = value; }
       }

       int _MXFB;
       /// <summary>
       /// 使用参数定义HFB 屏障个数
       /// </summary>
       public int MXFB
       {
           get { return _MXFB; }
           set { _MXFB = value; }
       }
       int _NHFBNP;
       /// <summary>
       /// 不使用参数定义HFB 屏障个数
       /// </summary>
       public int NHFBNP
       {
           get { return _NHFBNP; }
           set { _NHFBNP = value; }
       }

       int _NACTHFB;
       /// <summary>
       /// 激活的HFB参数数目
       /// </summary>
       public int NACTHFB
       {
           get { return _NACTHFB; }
           set { _NACTHFB = value; }
       }

       List<PHFB> pHFBs = new List<PHFB>();
       /// <summary>
       /// 
       /// </summary>
       public List<PHFB> PHFB
       {
           get { return pHFBs; }
           set { pHFBs = value; }
       }


       public override void WriteFile(string path)
       {
           string content = "# HuanAnKeJi GHB File" + "\r\n";
           content+=this .NPHFB +"    "+this .MXFB +"    "+this .NHFBNP+ "\r\n";
           string str = "";
           foreach (PHFB item in PHFB)
           {
               str += item.Layer + "    " + item.IROW1 + "    " + item.ICOL1 + "    " + item.IROW2 + "    " + item.ICOL2 + "    " + item.Hydchr + "\r\n";
           }
           content += str;
           content += this.NACTHFB + "\r\n";
           string fname = path + this.Fname;
           FXnaInfrastructure.FileHelper.WriteFile(fname, content);
       }

       

    }

   public class PHFB
   {
       int _IROW1;

       public int IROW1
       {
           get { return _IROW1; }
           set { _IROW1 = value; }
       }
       int _ICOL1;

       public int ICOL1
       {
           get { return _ICOL1; }
           set { _ICOL1 = value; }
       }

       int _IROW2;

       public int IROW2
       {
           get { return _IROW2; }
           set { _IROW2 = value; }
       }
       int _ICOL2;

       public int ICOL2
       {
           get { return _ICOL2; }
           set { _ICOL2 = value; }
       }
       int _Layer;

       public int Layer
       {
           get { return _Layer; }
           set { _Layer = value; }
       }
       double _Factor;

       public double Factor
       {
           get { return _Factor; }
           set { _Factor = value; }
       }

       double _Hydchr;

       public double Hydchr
       {
           get { return _Hydchr; }
           set { _Hydchr = value; }
       }

     

       string _Pname;

   }
}
